import React from 'react'
function Hello (){
    const clickHandler = (e,msg)=>{
        console.log(e)
        console.log("xxxxxx",msg)
    }
   return (
       <button onClick={(e)=>clickHandler(e,'pink')}>11111</button>
   )
}

class Hello2 extends  React.Component{
    clickHandler = (e,msg)=>{
        console.log(e)
        console.log("xxxxxx",msg)
    }
    render(){
        return (
            <button onClick={(e)=>this.clickHandler(e,'red')}>22222</button>
        )
    }
}
function App(){
   return (
       <>
       <Hello></Hello>
       <Hello2></Hello2> 
       </>
   )
}
export default App